package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.etc.EtcInvoiceRequest;
import com.cxso.example.request.etc.EtcWaybillEndRequest;
import com.cxso.example.request.etc.EtcWaybillStartRequest;
import com.cxso.example.response.etc.EtcInvoiceResponse;
import com.cxso.example.response.etc.EtcWaybillEndResponse;
import com.cxso.example.response.etc.EtcWaybillStartResponse;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "ETC发票")
public class EtcClient extends Client {

    public EtcClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "运单开始接口")
    public Result<EtcWaybillStartResponse> operateWaybillStart(EtcWaybillStartRequest etcWaybillStartRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/etc/operateWaybillStart", HttpMethod.POST, etcWaybillStartRequest).toEntity(EtcWaybillStartResponse.class);
    }

    @Schema(description = "运单结束")
    public Result<EtcWaybillEndResponse> operateWaybillEnd(EtcWaybillEndRequest etcWaybillEndRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/etc/operateWaybillEnd", HttpMethod.POST, etcWaybillEndRequest).toEntity(EtcWaybillEndResponse.class);
    }

    @Schema(description = "运单编号查询发票数据")
    public Result<EtcInvoiceResponse> operateInvoice(EtcInvoiceRequest etcInvoiceRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/etc/operateInvoice", HttpMethod.POST, etcInvoiceRequest).toEntity(EtcInvoiceResponse.class);
    }

}
